adTempus API
PreviousUpNext
IJob::GetExecutionHistory Method

Gets the execution history for the job

C++
HRESULT GetExecutionHistory(long maxRecords, long * foundRecords, [out,retval] IExecutionHistoryItems** pVal);
C#
GetExecutionHistory(long maxRecords, ref long foundRecords, [out,retval] IExecutionHistoryItems* pVal);
Visual Basic
Sub GetExecutionHistory(maxRecords As long, ByRef foundRecords As long, pVal As [out,retval] IExecutionHistoryItems*)
Parameters 
Description 
[in] long maxRecords 
The maximum number of records to retrieve. Use 0 for all records (not recommended). See Remarks 
[out] long * foundRecords 
The number of records found for the job. May be greater than the number of records returned. 
[out,retval] IExecutionHistoryItems** pVal 
The history records. 

Each time the job is executed, a new ExecutionHistoryItem object is created to represent that instance of the job. These history records are periodically purged, based on the job's HistoryRetentionOptions and HistoryRetentionLimit

GetExecutionHistory gets all ExecutionHistoryItems for the job. The data is refreshed from the server if necessary to get the latest information. 

Because retrieving the data from the database and transmitting it to the client can be time-consuming, you can limit the number of records returned by using the maxRecords parameter. The returned collection is always sorted in descending order by the instance ID, so if you limit the number of records to n, you will receive the most recent n instances. 

To get the most recent instance, for example, set maxRecords to 1. 

When the method returns foundRecords is set to the number of instances that actually exist for the job. User-interface applications therefore can first call the method with some reasonable value for maxRecords and then, if foundRecords exceeds this number, prompt the user before calling the method again to retrieve all records (this is the approach used by the adTempus Console). 

Each call only retrieves records that have been created since the last time the method was called, so calling the method frequently does not result in the same data being repeatedly sent from the server.

adTempus API Reference version 3.0.0.0, revised 10/30/2008